package com.jiyi.activity;

import android.os.Build;
import android.os.Bundle;
import android.view.View;

import com.jiyi.inteface.RevealListen;
import com.swift.base.ActivityBase;
import com.swift.maintenance.R;
import com.swift.maintenance.utils.AnimationUtil;

public class LActivity extends ActivityBase implements RevealListen {

    protected int x, y;

    @Override
    protected void onCreate(
            Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onAnimatStart() {

    }

    @Override
    public void onAnimatStop() {

    }

    protected void setupAnimator(final View view, final int x, final int y) {
        view.post(new Runnable() {
            @Override
            public void run() {
                AnimationUtil.animateRevealShow(LActivity.this, view, x, y, 0, R.color.white, LActivity.this);
            }
        });
    }

    protected void onBackActivity(final View root, int x, int y) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            AnimationUtil.animateRevealHide(this, root, x, y, 0, R.color.white, this);
        } else {
            finish();
        }
    }

    protected void onBackActivity(final View root) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            AnimationUtil.animateRevealHide(this, root, x, y, 0, R.color.white, this);
        } else {
            finish();
        }
    }
}
